<?php
/**
 * Created by PhpStorm.
 * User: myhonour
 * Date: 2017/10/9
 * Time: 6:42
 */

namespace app\index\controller;


use think\Controller;
use think\Request;
use app\admin\model\Config;

class Common extends Controller
{
    public function __construct(Request $request = null)
    {
        // 获取配置
        \config('C',Config::getConf());
        // 获取主题
        $this->defaultTheme();
        parent::__construct($request);


    }

    public function _initialize()
    {

    }

    private function defaultTheme(){
        $default    =   ROOT_PATH.'themes'.DS;
        $default    .=   \config('C.DEFAULT_THEME')?:'default';
        $default    .=  DS;
        \config('template.view_base',$default);
    }
}